// import AppLayout from '@/components/layout/AppLayout.vue'
import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import AppLayout from '../components/layout/AppLayout.vue'
import IndexView from '../views/IndexView.vue'
import Login from '../views/Login.vue';  

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'AppLayout',
      component: AppLayout,
      children: [
      {
        path: '',
        name: 'IndexView',
        component: IndexView
      },
      {
        path: '/menus',
        name: 'menus',
        component: () => import('../views/menu/MenuIndex.vue')
      },
      {
        path: '/menus/create',
        name: 'menu-create',
        component: () => import('../views/menu/CreateOrEdit.vue')
      },
      {
        path: '/menus/:id/edit',
        name: 'menu-edit',
        component: () => import('../views/menu/CreateOrEdit.vue')
      },
      {
        path: '/resources',
        name: 'resources',
        component: () => import('../views/resources/ResourcesIndex.vue')
      },
      {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (About.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/AboutView.vue')
    },
    {
      path: '/:xxx(.*)*',
      name: 'NotFound',
      component: () => import('../views/NotFound.vue')
    },
    ]
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
  ]
})

export default router
